package com.foxitcloud.webpdf.calldll;

public class FXPDFToImageMgr {
	private long handle = 0;
	
	public FXPDFToImageMgr(String fontPath)
	{
		this.handle =  createPDFToImageMgr(fontPath);
	}
	
	protected void finalize() {
		release();
	}
	
	public void release()
	{
		Na_release(this.handle);
		this.handle = 0;
	}
	
	private static long createPDFToImageMgr(String fontPath)
	{
		return Na_createPDFToImgMgr(fontPath);
	}
	
	public FXPDFToImageHandle createPDFToImgHandler()
	{
		long imgHandle = Na_createPDFToImgHandler(this.handle);
		if(imgHandle ==0)
			return null;
		return new FXPDFToImageHandle(imgHandle);
	}
	
	protected final static native long Na_createPDFToImgMgr(String fontPath);
	protected native long Na_createPDFToImgHandler(long mgrHandle);
	protected native void Na_release(long handle);
}
